/**
 * Copyright (c) 2009-2011, chunquedong(YangJiandong)
 * 
 * This file is part of ChunMap project
 * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE(Version >=3)
 * 
 * History:
 *     2010-05-05  Jed Young  Creation
 */
package chunmap.service;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import chunmap.util.Logger;

public class RequestDispatcher extends HttpServlet {
	private static final long serialVersionUID = 8504367870459274730L;
	private static final Logger Log = new Logger(Logger.Debug,RequestDispatcher.class
			.getName());

	@Override
	public void service(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, java.io.IOException {

		String serviceStr = request.getParameter("SERVICE");
		Service ser = ServiceFactory.getService(serviceStr);
		
		if(Log.isDubug()){
			Log.debug("收到服务请求："+serviceStr);
		}

		ser.service(request, response);
	}
}